package com.jinzhi.jzweb.service.impl;

import com.baomidou.mybatisplus.plugins.Page;
import com.jinzhi.common.base.CoreServiceImpl;
import com.jinzhi.jzapi.examination.pojo.ExaminationsVo;
import com.jinzhi.jzweb.dao.ExaminationBatchComSDao;
import com.jinzhi.jzweb.domain.ExaminationBatchComSDO;
import com.jinzhi.jzweb.service.ExaminationBatchComSService;
import org.apache.commons.lang3.StringUtils;
import org.springframework.stereotype.Service;

import java.util.List;
import java.util.Map;

/**
 * 
 * <pre>
 * 考试批次
 * </pre>
 * <small> 2020-02-24 21:00:12 | lance</small>
 */
@Service
public class ExaminationBatchComSServiceImpl extends CoreServiceImpl<ExaminationBatchComSDao, ExaminationBatchComSDO> implements ExaminationBatchComSService {


    @Override
    public List<Map<Object,Object>> selByAll(){
        return baseMapper.selByAll();
    }

    @Override
    public ExaminationsVo selExaminations(){
        return baseMapper.selExaminations();
    }
    
    @Override
    public List<ExaminationBatchComSDO> selExamNowList(){
    	return baseMapper.selExamNowList();
    }

    @Override
    public List<ExaminationsVo> selListExaminationsNowCeshi() {
        return baseMapper.selListExaminationsNowCeshi();
    }

    @Override
    public List<ExaminationsVo> selListExaminationsNow(){
        return this.baseMapper.selListExaminationsNow();
    }


    @Override
    public List<ExaminationsVo> selListExaminationsComNow(Integer type){
        return this.baseMapper.selListExaminationsComNow(type);
    }

    @Override
    public List<ExaminationsVo> selExaminationComAll3() {
        return this.baseMapper.selExaminationComAll3();
    }


    @Override
    public Long findByCbatchId(String id) {
        return baseMapper.findByCbatchId(id);
    }

    @Override
    public Page<Map<Object,Object>> selByNameCbatchId(int current, int number, String name,String cbatchId) {

        Page<Map<Object,Object>> page = new Page<>(current, number);

        List<Map<Object,Object>> list;
        if(StringUtils.isNotBlank(cbatchId)){
            list = this.baseMapper.selByNameCbatchId(page,name,Long.parseLong(cbatchId));
        }else{
            list = this.baseMapper.selByNameNoCbatchId(page,name);
        }
        return page.setRecords(list);
    }



    @Override
    public List<ExaminationBatchComSDO> selListExamBatch(Map map){
        return this.baseMapper.selListExamBatch(map);
    }

    @Override
    public List<Map<Object, Object>> selTimeAll() {

        return baseMapper.selBatchTimeAll();
    }

    @Override
    public List<ExaminationsVo> selListExaminationsTeachers() {
        return baseMapper.selListExaminationsTeachers();
    }

    @Override
    public List<ExaminationsVo> selListExaminationsScreen() {
        return baseMapper.selListExaminationsScreen();
    }

    @Override
    public List<Map<Object, Object>> selTimeComAll() {
        return baseMapper.selBatchTimeComAll();
    }

    @Override
    public List<ExaminationsVo> selListExaminationsComNowAll() {
        return baseMapper.selListExaminationsComNowAll();
    }
}
